package org.lzfto.flink.demo.business.orders;

import org.lzfto.flink.demo.common.data.PagingOperation;
import org.lzfto.flink.demo.common.result.PubResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;


@Service
public class SimpleOrderService  extends PagingOperation{

    private final Logger LOGGER = LoggerFactory.getLogger(getClass());

    public PubResult<Integer> deleteAll(){
    	LOGGER.warn("清除表test_target.orders_target");
    	String sql="select count(*) from test_target.orders_target";
    	int rowsQty=jdbcTemplate.queryForObject(sql, Integer.class);
        String truncateSql="""
        		truncate table   test_target.orders_target
        		""";
        jdbcTemplate.execute(truncateSql);
        LOGGER.info("删除表test_target.orders_target中的{}条记录",rowsQty);
        return PubResult.ok("成功", rowsQty);
    }
}
